package com.thinking.stormStudy;

import java.util.Map;

import org.apache.storm.task.OutputCollector;
import org.apache.storm.task.TopologyContext;
import org.apache.storm.topology.OutputFieldsDeclarer;
import org.apache.storm.topology.base.BaseRichBolt;
import org.apache.storm.tuple.Fields;
import org.apache.storm.tuple.Tuple;
import org.apache.storm.tuple.Values;

public class ExclamationBolt extends BaseRichBolt {
	private static final long serialVersionUID = 1L;
	OutputCollector _collector;


	@Override
	public void prepare(Map conf, TopologyContext context, OutputCollector  collector) {
	 _collector=collector;	
	}
	
	public void execute(Tuple tuple) {
	//	  this._collector.emit(tuple,new Values(tuple.getString(0)+"-----"));
		  System.out.println("----我tuple获取字符为------"+tuple.getStringByField("word"));
		  this._collector.ack(tuple);
	}
	

	@Override
	public void declareOutputFields(OutputFieldsDeclarer  declarer) {
		
	//	declarer.declare(new Fields("words"));
	}

}
